$baseU: 10;
$w: #FFFFFF;
$b: #000000;
$green: #00FF80;
$blue: #0080FF;
$blue2: #19E8FF;
$magenta: #FF00B1;
$yellow: #FFFF00;
$red: #e91e53;
$w2: #CCC;
$baseFontSize: 12;
$fontFamily: "Menlo",
monospace;

body {
    background-color: $b;
    color: $w;
    font-family: $fontFamily;
    font-weight: 100;
    line-height: 1.4em;
    font-size: $baseFontSize + px;
    margin: 0;
    min-width: 1000px;
}

a {
    color: $magenta;
    text-decoration: none;
}

p {
    padding: 0;
    margin: 0;
    line-height: 1.4em;
}

.warning {
    color: $red;
}

.right {
    text-align: right;
}

.looked-text {
    color: $green;
}

.clicked-external-text {
    color: $blue2;
}

.clicked-like-text {
    color: $blue;
}

.typed-text {
    color: $yellow;
}

#user {
    width: 80vw;
    max-width: 760px;
    padding: $baseU * 1 + px;
    .info-row div {
        display: inline-block;
    }
    .info-label {
        vertical-align: top;
        width: 110px;
    }
    .info-content {
        width: calc(100% - 120px);
    }
}

#fbshare,
#twshare {
    color: #FF00B1;
    cursor: pointer;
}

#main {
    width: 100%;
    margin: 20px auto;
    overflow: hidden;
}

footer {
    display: none;
    padding: $baseU * 1 + px;
    height: 100px;
    margin: 50px 0 0 0;
}

#status {
    position: absolute;
    padding: 0;
    margin: 0;
    top: $baseU * 0 + px;
    right: $baseU * 0 + px;
    text-align: right;
    img {
        -webkit-filter: grayscale(1) invert(1);
        filter: grayscale(1) invert(1);
        width: 50px;
        height: 50px;
        margin: $baseU * 1 + px;
        background-color: $w;
        border: 1px solid $b;
    }
}

.tool-tip:hover {
    cursor: pointer;
}

.tool-tip::before {
    content: attr(data-tooltip);
    background-color: rgba(80, 80, 80, 0.9);
    color: $w;
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: 1000;
    padding: 5px;
    left: 0;
    top: -5px;
    opacity: 0;
    overflow: hidden;
    font-size: 11px;
}

.tool-tip:hover::before {
    opacity: 1;
    top: 15px;
    overflow: visible;
    width: 180px;
    height: auto;
}

#legend div {
    display: inline-block;
    position: relative;
}

#the-good-stuff,
#the-cool-stuff {
    opacity: 0;
    width: inherit;
    background-color: $b;
}

#the-good-stuff {
    position: fixed;
}

#the-cool-stuff {
    input {
        width: 40px;
        text-align: center;
        border: 0;
    }
    #shift-time {
        position: absolute;
        bottom: 10px;
        div {
            display: inline-block;
            background-color: $b;
            color: $w;
            border: 1px solid $w;
            padding: 0px 5px;
            height: 1.2em;
            &:hover {
                cursor: pointer;
            }
            &:focus {
                outline: 0;
            }
        }
    }
}

#progressAnim {
    width: 0px;
    margin: $baseU * 1 + px;
    height: 15px;
    position: absolute;
    background-image: repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255, 255, 255, 1) 3px, rgba(255, 255, 255, 1) 3px);
}

#init-message,
#usage-message,
#loading {
    width: calc(100% - 20px);
    padding: 10px;
    display: none;
}

#loading {
    animation: fade 1s linear infinite alternate;
}

#funnel {
    height: $baseU * 2 + px;
    margin: $baseU * 2 + px $baseU * 1 + px $baseU * 4 + px $baseU * 1 + px;
    border-bottom: 1px solid $w;
    border-left: 1px solid $w;
    border-right: 1px solid $w;
    div {
        width: $baseU * 2 + px;
        height: $baseU * 3 + px;
        border-left: 1px solid $w;
        border-right: 1px solid $w;
        background-color: $b;
        position: absolute;
        left: 0;
        right: 0;
        margin: $baseU * 1 + px auto;
    }
}

.wrapper {
    display: flex;
    width: inherit;
    list-style: none;
    padding: 0;
    margin: $baseU * 1 + px $baseU * 0 + px $baseU * 4 + px $baseU * 0 + px;
    a {
        color: $w2;
        border-bottom: 1px solid $magenta;
        text-decoration: none;
    }
    &.col-1 li {
        width: 100%;
    }
    &.col-3 li {
        width: 33.3%;
    }
    &.col-2 li {
        width: 50%;
    }
    &.col-1-3 {
        li:first-child {
            width: 25%;
        }
        li {
            width: 75%;
        }
    }
    &.col-2-2-1 {
        li:first-child,
        li:nth-child(2) {
            width: 40%;
        }
        li {
            width: 20%;
        }
    }
    li .container {
        flex-grow: 1;
        height: 100%;
        position: relative;
        margin: $baseU * 1 + px;
        border: 1px solid $w;
        .container-title {
            color: $red;
            background-color: $b;
            position: absolute;
            padding: 0 4px;
            top: -8px;
            left: 5px;
        }
        .tech-label {
            color: $w2;
            background-color: $b;
            position: absolute;
            padding: 0 4px;
            top: -8px;
            right: 5px;
            &:hover {
                cursor: pointer;
            }
        }
        .tech-label::before {
            content: attr(data-tooltip);
            background-color: rgba(80, 80, 80, 0.9);
            color: $w;
            width: 100%;
            height: 100%;
            position: absolute;
            padding: 2px;
            left: -5px;
            top: -5px;
            opacity: 0;
            font-size: 11px;
            overflow: hidden;
        }
        .tech-label:hover::before {
            opacity: 1;
            padding: 5px 8px;
            overflow: visible;
            width: 120px;
            left: -110px;
            top: 15px;
            height: auto;
        }
        .content {
            padding: $baseU + px;
            padding-top: 15px;
            line-height: 1.3em;
            overflow: scroll;
            p {
                margin: 0 0 1em 0;
                color: $w2;
                white-space: pre-line;
            }
            .error {
                color: #999;
                display: none;
            }
            .last-updated {
                margin: 0;
                position: absolute;
                bottom: 5px;
                right: 10px;
                font-size: 10px;
            }
            #still-loading {
                margin: 0;
                position: absolute;
                bottom: 5px;
                left: 10px;
                font-size: 10px;
                animation: fade 1s linear infinite alternate;
                display: none;
            }
            .tab {
                width: 50px;
                display: inline-block;
            }
            .line,
            .line-dashed {
                height: 1px;
                margin: 5px 0;
                display: inline-block;
            }
            .line {
                border-top: 2px solid #999;
            }
            .line-dashed {
                border-top: 1px dashed #555;
            }
            .Rtable {
                display: flex;
                flex-wrap: wrap;
                margin: 0;
                padding: 0;
            }
            .cell {
                box-sizing: border-box;
                flex-grow: 1;
                width: 100%; // Default to full width
                overflow: hidden; // Or flex might break
                padding: 0 0 15px 0;
                list-style: none;
                overflow-wrap: break-word;
            }
            .Rtable--2cols {
                .cell:nth-child(odd) {
                    width: 60px;
                }
                .cell:nth-child(even) {
                    width: calc(100% - 60px);
                }
            }
            .Rtable--2cols-m {
                .cell:nth-child(odd) {
                    width: 100px;
                }
                .cell:nth-child(even) {
                    width: calc(100% - 100px);
                }
            }
            .Rtable--2cols-l {
                .cell:nth-child(odd) {
                    width: 130px;
                }
                .cell:nth-child(even) {
                    width: calc(100% - 130px);
                }
            }
            .Rtable--3cols {
                .cell {
                    width: 33.33%;
                }
            }
            .Rtable--4cols {
                .cell {
                    width: 25%;
                }
            }
            .Rtable--4cols-s-s-m {
                .cell:nth-child(4n+1),
                .cell:nth-child(4n+2) {
                    width: 60px;
                }
                .cell:nth-child(4n+3) {
                    width: 90px;
                }
                .cell:nth-child(4n) {
                    width: calc(100% - 210px);
                }
            }
        }
    }
}

#religion-chart,
#politics-chart {
    list-style: none;
    padding: 0;
    display: flex;
    div {
        height: 140px;
        position: relative;
        div {
            width: 15px;
            height: 0%;
            min-height: 2px;
            position: absolute;
            margin: auto;
            left: 0;
            right: 0;
            bottom: 0;
            background-image: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(255, 255, 255, 1) 3px, rgba(255, 255, 255, 1) 3px);
        }
    }
    .bar-6 {
        width: 16.6%;
    }
    .bar-4 {
        width: 25%;
    }
    p {
        text-align: center;
        margin: 0;
        padding: 5px 0 0 0;
        white-space: pre-line;
    }
}

// consumption-vis
#consumption-vis,
#ocean-vis,
#religion-chart,
#politics-chart {
    width: 100%;
    path {
        stroke-width: 1;
    }
    .label {
        fill: #999;
        font-size: 11px;
        text-anchor: middle;
    }
    .ibmocean {
        stroke: $yellow;
    }
    .amsocean {
        stroke: $green;
    }
    .axis path,
    .axis line {
        fill: none;
        stroke: $w;
        stroke-dasharray: 1, 2;
        shape-rendering: crispEdges;
    }
    .gridline {
        stroke: #555;
        stroke-dasharray: 3, 1;
    }
    .axis text {
        font-family: $fontFamily;
        font-size: 11px;
        fill: $w;
    }
    .tooltip {
        position: absolute;
        z-index: 1000;
        width: 200px;
        pointer-events: none;
        overflow-wrap: break-word;
        padding: 5px;
        background-color: rgba(0, 0, 0, 0.8);
        white-space: pre-line;
        &:hover {
            cursor: pointer;
        }
    }
}

@keyframes fade {
    0% {
        opacity: 0.4;
    }
    100% {
        opacity: 1;
    }
}